package com.sanyang.lawyer.mapper.audit;

import com.sanyang.lawyer.entity.Audit;
import com.sanyang.lawyer.entity.Case_audit;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

@Component
public interface Audit_closeLawMapper {

    //审核表中添加数据   流程id，提交人，提交备注，    类型id，提交时间。审核状态。
    @Insert("insert into audit (auditid,submitid,remark,typeid,submit_time,state)" +
            "values(#{auditid},#{submitid.userId},#{remark},#{typeid.typeid},#{submitTime},#{state})")
    public void insertCloseOne(Audit audit);


    //案件和审核表中间表添加数据 案件id，审核id。
    @Insert("insert into case_audit(caseid,auditid)" +
            "values(#{caseid.caseId},#{auditid.auditid})")
    public void insertCase_auditOne(Case_audit audit);


    //2：审核表数据修改
    @Update("update audit set audit_time=#{auditTime},audit_userid=#{auditUserid.userId}," +
            "comment=#{comment},if_pass=#{if_pass} ,state = '已审核'" +
            " where auditid=#{auditid}")
    public void completeProcess(Audit audit);
    
    
}
